-
Notifications
You must be signed in to change notification settings - Fork 0
chore: #1 pnpm workspace, ESLint, Prettier, TypeScript, minimal client #32
Conversation
Sets up the tooling so four people can work in parallel and the same quality gates run locally and in CI. - pnpm workspace with client/ only. server/ and e2e/ join in M2 and M4 rather than existing as empty packages now. - tsconfig.base.json: strict + noUncheckedIndexedAccess. - ESLint 9 flat config (typescript-eslint, react-hooks, jsx-a11y, react-refresh) with eslint-config-prettier applied last. The bar is 0 warnings so CI can enforce it. - Prettier with .prettierrc.json and .prettierignore. - Root scripts: dev, build, lint, format, format:check, typecheck, test. - AGENTS.md documenting the architecture rules we agreed on (SQL-side sort/filter, keyset pagination, DataLoaders, simulated users, plain CSS, accessibility non-negotiable, search state in the URL). - A minimal client that renders the product name, a skip link and a main landmark, purely to prove the gates are green. #9 replaces it with the mock-data search interface. Co-Authored-By: opencode <noreply@opencode.ai>
House style is plain hyphens. No functional change. Co-Authored-By: opencode <noreply@opencode.ai>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pnpm format:check fails for me on a clean checkout on Windows and reports formatting issues in 17 files. I checked the line endings and get i/lf w/crlf, and I have core.autocrlf=true, so it looks like an LF/CRLF issue rather than the files actually being formatted incorrectly. Could we add .gitattributes or something similar so the format check works consistently on Windows too?
Found in review of #32: pnpm format:check fails on a clean checkout on Windows for 17 files that are actually formatted correctly. The cause is core.autocrlf=true, the Git for Windows default, which rewrites the checked-out files to CRLF. Prettier then sees different bytes than the ones committed and reports failures that do not exist. Setting `* text=auto eol=lf` means all four of us see the same bytes regardless of platform, so format:check behaves identically everywhere. Shell scripts keep LF for shebangs; batch files get CRLF deliberately; binary assets are excluded from normalization. Renormalizing the tree produced no diff, so the committed files were already LF. This only fixes the checkout side. Reported by rachelks. Co-Authored-By: opencode <noreply@opencode.ai>
|
Good catch, and this was a real bug rather than a config nit. Thank you for testing with Cause: Git for Windows defaults to Fix: I also ran Pushed to this branch. Could you re-run |
Found by actually verifying rather than assuming: PR #34 targets feat/1-repo-tooling because it is stacked on #32, and the workflow's `pull_request: branches: [main]` filter silently skipped CI for it. The push of 6ab73b6 produced no run at all. Stacked PRs are how we are working (see docs/WORKFLOW.md), so a branch filter on pull_request is wrong. pull_request now has no filter and runs for every PR whatever it targets; push stays limited to main so we only deploy from the mainline. Co-Authored-By: opencode <noreply@opencode.ai>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-tested with a fresh Windows checkout and core.autocrlf=true. pnpm format:check now passes, so the .gitattributes fix resolves the issue I found.
The workflow is on main for the first time. PR #34 merged into feat/1-repo-tooling (its base at the time) after #32 had already merged that branch into main, so the workflow never reached main and the repo has been running with no CI at all. This brings it across. Content is unchanged from what #34 reviewed and what has been passing on the runner: quality job (format, lint, typecheck, test, build, bundle budget) on every PR and every push to main, deploy job on push to main only. Two fixes that came out of actually running it: - pull_request has no branch filter. A `branches: [main]` filter meant stacked PRs like #34, which targets feat/1-repo-tooling, silently got zero CI runs. - deploy is pinned to [self-hosted, linux, x64, project2]. It writes to /var/www/html/project2 and restarts crate-api, which only exist on it2810-19. quality stays unpinned so any future runner can pick it up. Co-Authored-By: opencode <noreply@opencode.ai>
What this does
Sets up the repo tooling for #1 so the four of us can work in parallel and the same quality gates run locally and in CI.
pnpmwithclient/only.server/ande2e/join in M2 and M4 rather than existing as empty packages now.tsconfig.base.jsonwithstrictandnoUncheckedIndexedAccessdev,build,lint,lint:fix,format,format:check,typecheck,test,test:watchAGENTS.mdwith the architecture rules we agreed onThe client is a skeleton only - it renders the product name, a skip link and a
mainlandmark. Its whole job is to prove the gates are green before #9 replaces it with the mock-data search interface.What was done
pnpm-workspace.yaml) declaringclient/tsconfig.base.jsonextended by the clienteslint.config.js- TypeScript rules for everything, React + a11y rules scoped toclient/**.prettierrc.json/.prettierignore.gitignoreincluding*.tsbuildinfopackage.jsonwith the scripts aboveAGENTS.md- the rules that make the graded requirements work (SQL-side sort/filter, keyset pagination, DataLoaders, simulated users, plain CSS, accessibility non-negotiable, search state in the URL)client/minimal React + Vite + Vitest setupWhat was tested
Ran from a clean
pnpm install:The three tests cover:
#mainmainlandmark existsTwo accessibility details are already wired in so #9 inherits them rather than retrofitting: the skip link, and
:focus-visibleoutlines.prefers-color-schemeandprefers-reduced-motionare in from the start.Notes on choices
noUncheckedIndexedAccessis annoying to write against. It is deliberate - it catches the "index might be undefined" class of bug at compile time, which is exactly the kind that surfaces later as a blank row in the results list.pnpm lintis what CI runs, so the bar has to be enforceable rather than aspirational.client/in the workspace. Emptyserver//e2e/packages would show the eventual shape but add nothing to review today.Closes
Closes #1.